package core.web.spring.examples.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import core.tool.log.log4j.EasyLogger;
import core.web.spring.examples.domain.User;


@Controller
@RequestMapping("/login")
public class LoginController {


	@RequestMapping("/doLogin")
	public ModelAndView login(HttpServletRequest request, User user) {
		EasyLogger.debug("spring mvc注解调用成功...ok");
		ModelAndView mav = new ModelAndView();
		mav.setViewName("../../index");
		return mav;
	}

	
	@RequestMapping("/doLogout")
	public String logout(HttpSession session) {
		return "forward:/index.jsp";
	}

}
